#ifndef MAINWIDGET_H
#define MAINWIDGET_H

#include <QWidget>
#include <QTimer>


namespace Ui {
class MainWidget;
}

class tcp_client;
class QPushButton;

class MainWidget : public QWidget
{
    Q_OBJECT

public:
    explicit MainWidget(QWidget *parent = nullptr, std::shared_ptr<tcp_client> client = nullptr);
    ~MainWidget();

    void setIsMatching(bool isMatching);

    QPushButton &matchingButton();

    void closeEvent(QCloseEvent *event) override;

signals:
    void hideWindow();

private:
    Ui::MainWidget *ui;
    std::shared_ptr<tcp_client> clientPtr_;
    QTimer timer_;
    uint32_t seconds_ = 0;

    bool isMatching_ = false;   /* 是否正在匹配中 */
};

#endif // MAINWIDGET_H
